import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    /*不变显示区域*/
    component: HomeView,
    redirect:'/sys-admin/index',
    children:[
        /*首页*/
      {
        path: '/sys-admin/index',
        component:()=>import('../views/sys-admin/IndexView.vue')
      },
      {
        path: '/sys-admin/temp/banner/add-new',
        component: () => import('../views/sys-admin/index_temp/ProductAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/product/list',
        component: () => import('../views/sys-admin/index_temp/ProductListView.vue')
      },
      {
        path: '/sys-admin/temp/banner/add-new',
        component: () => import('../views/sys-admin/index_temp/BannerAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/banner/list',
        component: () => import('../views/sys-admin/index_temp/BannerListView.vue')
      },
      {
        path: '/sys-admin/temp/result',
        component: () => import('../views/sys-admin/temp/Result.vue')
      },
      {
        path: '/sys-admin/temp/detail',
        component: () => import('../views/sys-admin/temp/Detail.vue')
      },
      {
        path: '/sys-admin/temp/banner2_introduce',
        component: () => import('../views/sys-admin/temp/Banner2_introduce.vue')
      },
    ]
  },
  {
    path: '/about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/admin-login',
    component: () => import('../views/AdminLogin.vue')
  },
  {
  path: '/sys-admin/reg',
      component: () => import('../views/Reg.vue')
},
  {
    path: '/sys-admin/login',
    component: () => import('../views/Login.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
